* Political knowledge code .
* Start with a data file that contains the redacted open-ended responses and case ID and response flag as well as coders' ratings. 


*** FLAG DIFFERENCES AMONG CODERS' RATINGS .

* flag differences for Roberts.
compute robertsDIFF = 0.
if robertsd1 ne robertsf1 or robertsf1 ne robertsi1 or robertsi1 ne robertsw1 robertsdiff = robertsdiff+1 .
if robertsd2 ne robertsf2 or robertsf2 ne robertsi2 or robertsi2 ne robertsw2 robertsdiff = robertsdiff+1 .
if robertsd3 ne robertsf3 or robertsf3 ne robertsi3 or robertsi3 ne robertsw3 robertsdiff = robertsdiff+1 .
if robertsd4 ne robertsf4 or robertsf4 ne robertsi4 or robertsi4 ne robertsw4 robertsdiff = robertsdiff+1 .
if robertsd5 ne robertsf5 or robertsf5 ne robertsi5 or robertsi5 ne robertsw5 robertsdiff = robertsdiff+1 .

* flag differences for Pelosi.
compute pelosiDIFF = 0.
if pelosiD1 ne pelosiF1 or pelosiF1 ne pelosii1 or pelosii1 ne pelosiw1 pelosidiff = pelosidiff +1.
if pelosiD2 ne pelosiF2 or pelosiF2 ne pelosii2 or pelosii2 ne pelosiw2 pelosidiff = pelosidiff +1.
if pelosiD3 ne pelosiF3 or pelosiF3 ne pelosii3 or pelosii3 ne pelosiw3 pelosidiff = pelosidiff +1.

* flag differences for Cheney.
compute cheneydiff = 0.
if cheneyd1 ne cheneyf1 or cheneyf1 ne cheneyi1 or cheneyi1 ne cheneyw1 cheneydiff = 1.

* flag differences for Brown .
compute browndiff = 0.
if brownd1 ne brownf1 or brownf1 ne browni1 or browni1 ne brownw1 browndiff = browndiff + 1.
if brownd2 ne brownf2 or brownf2 ne browni2 or browni2 ne brownw2 browndiff = browndiff + 1.
if brownd3 ne brownf3 or brownf3 ne browni3 or browni3 ne brownw3 browndiff = browndiff + 1.
fre robertsdiff pelosidiff cheneydiff browndiff .

* flag differences for the nonresponse codes.
compute B_dkdiff=0.
if browndk_d ne browndk_f or browndk_f ne browndk_i or browndk_i ne browndk_w B_dkdiff=B_dkdiff+1.
compute C_dkdiff=0.
if cheneydk_D ne cheneydk_f or cheneydk_f ne cheneydk_i or cheneydk_i ne cheneydk_w C_dkdiff = C_dkdiff+1.
compute P_dkdiff=0.
if pelosidk_d ne pelosidk_f or pelosidk_f ne pelosidk_i or pelosidk_i ne pelosidk_w P_dkdiff = p_dkdiff+1.
compute R_dkdiff=0.
if robertsdk_d ne robertsdk_f or robertsdk_f ne robertsdk_i or robertsdk_i ne robertsdk_w R_dkdiff=R_dkdiff+1.
fre b_dkdiff c_dkdiff p_dkdiff r_dkdiff .



* list cases .

tem.
sel if robertsdiff > 0.
list V080001 roberts 
robertsd1 robertsf1 robertsi1 robertsw1 space
robertsd2 robertsf2 robertsi2 robertsw2 space 
 robertsd3 robertsf3 robertsi3 robertsw3 space
 robertsd4 robertsf4 robertsi4 robertsw4 space
 robertsd5 robertsf5 robertsi5 robertsw5   .

tem.
sel if pelosidiff > 0.
list V080001 pelosi 
 pelosiD1 pelosiF1 pelosii1 pelosiw1  space
 pelosiD2 pelosiF2 pelosii2 pelosiw2  space
 pelosiD3 pelosiF3 pelosii3 pelosiw3 .

tem.
sel if cheneydiff > 0.
list V080001 cheney cheneyd1 cheneyf1 cheneyi1 cheneyw1 .

tem.
sel if browndiff > 0.
list V080001 brown 
brownd1 brownf1 browni1 brownw1 space 
brownd2 brownf2 browni2 brownw2 space 
brownd3 brownf3 browni3 brownw3 .

tem.
sel if B_dkdiff >0.
list v080001 brown browndk_d browndk_f browndk_i browndk_w.

tem.
sel if C_dkdiff>0.
list v080001 cheney cheneydk_d cheneydk_f cheneydk_i cheneydk_w.

tem.
sel if P_dkdiff>0.
list v080001 pelosi pelosidk_d pelosidk_f pelosidk_i pelosidk_w. 

tem.
sel if R_dkdiff>0.
list v080001 roberts robertsdk_d robertsdk_f robertsdk_i robertsdk_w. 



compute r1 = robertsd1 .
compute r2 =robertsd2.
compute r3 = robertsd3.
compute r4 = robertsd4.
compute r5 = robertsd5.
compute c1 = cheneyf1 .
compute p1 = pelosid1.
compute p2 =pelosid2. 
compute p3 = pelosid3. 
compute b1 = brownD1 .
compute b2 = brownD2 .

var lab r1 'consensus code roberts scheme 1'.
var lab r2 'consensus code roberts scheme 2'.
var lab r3 'consensus code roberts scheme 3'.
var lab r4 'consensus code roberts scheme 4'.
var lab r5 'consensus code roberts scheme 5'.
var lab c1 'consensus code cheney'.
var lab p1 'consensus code pelosi scheme 1'.
var lab p2 'consensus code pelosi scheme 2'.
var lab p3 'consensus code pelosi scheme 3'.
var lab b1 'consensus code brown scheme 1'.
var lab b2 'consensus code brown scheme 2'.
var lab b3 'consensus code brown scheme 3'.
exe.



* At this stage some manual corrections were made to the final codes to reflect consensus decisions .
* These corrections are reflected in the furnished data file.
* The manual corrections can be identified by comparing the "consensus code" variables to the 
*  earlier source variables, such as r1 compared to robertsd1, r2 compared to robertsd2, etc.







